﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"%>
<%@ Import Namespace="System.ServiceModel.Web" %>
<%@ Import Namespace="System.Web.Script.Services" %>
<%@ Import Namespace="System.Web.Services" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
        <script type="text/javascript" src="http://www.google.com/jsapi"></script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <input type="button" id="showButton" value="Show"/>
   <div id="result"></div>
    <script>
        $(document).ready(function () {
            $.ajax({
                type: "GET",
                url: "WebForm1.aspx/GetData",
                data:JSON.stringify() ,
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (msg) {
                    $('#result').html(msg.d);
                }
                
            });
        });
    </script>
    <script runat="server">
        
    [WebMethod]
    [ScriptMethod(UseHttpGet = true, ResponseFormat = ResponseFormat.Json)] 
    public static string GetData()
    {

        return "test";
    }
    
    
    
    </script>

</asp:Content>
